package com.zzt.ioc.controller;

import com.zzt.ioc.model.DBTypes;
import com.zzt.ioc.model.Person;
import jakarta.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;

import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * Description
 * User: panda
 * Date: 2025-02-22
 * Time: 16:26
 */
@Controller
public class YmlController {

    @Value("${my.key3}")
    private String myKey3;

    @Value("${my.key4}")
    private String myKey4;

    @Value("${person.id}")
    private Integer id;

//    @Value("${person}")
//    private Person person;

//    @Value("${dbtypes.ball}")
//    private Map<String, String> ball;

    @Autowired
    private Person person;

    @Autowired
    private DBTypes dbTypes;

    @PostConstruct
    public void init(){
        System.out.println("person.id:"+ id);
        System.out.println("myKey: " + myKey3);
        System.out.println("myKey2: " + myKey4);
        System.out.println("person: " + person);
        System.out.println("dbTypes: " + dbTypes);
//        System.out.println("ball: " + ball);
    }
}
